<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        class Dog {
            constructor(name, breed) {
                this.name = name;
                this.breed = breed;
            }
            bark(){
                console.log(`Bark Bark~ My name is ${this.name}`)
            }
            cuddle(){
                console.log(`I love you owner!`)
            }
            static info() {    //静态方法
                console.log(`A dog is better than a cat by 10 times`);
            }
            get desciption() {  //属性
                return `${this.name} is s ${this.breed} type of dog`
            }
            set nickNames(value){ //读
                this.nick = value.trim();
            }
            get nickNames(){  //写
                return this.nick;
            }
        }
        Dog.info();
        var dahuang = new Dog('Sunny', 'Goldren Doodle');
        // console.log(dahuang.info());
        console.log(dahuang.desciption);
        dahuang.nickNames = "大黄";
        console.log(dahuang.nickNames);
        console.log(dahuang.__proto__);
    </script>
</body>
</html>